import Vue from "vue";
import App from "./App.vue";
import router from "@/router";
import store from "@/store";
import "swiper/swiper-bundle.min.css";
import "swiper/swiper.min.css";
import VueLazyload from "vue-lazyload";
import jz from "@/assets/jz.png";

//全局组件注册
import TypeNav from "@/components/TypeNav";
import Carsousel from "@/components/Carousel";
import Pagination from "@/components/Pagination";
import { Button, MessageBox } from "element-ui";

Vue.config.productionTip = false;

Vue.component(TypeNav.name, TypeNav);
Vue.component(Carsousel.name, Carsousel);
Vue.component(Pagination.name, Pagination);
Vue.use(Button);

Vue.use(VueLazyload, {
  loading: jz,
});

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

// mock数据
import "@/mock/mockServe";

//同一引入请求接口
import * as API from "@/api";

//引入表单校验插件
import "@/plugins/validate";

new Vue({
  render: (h) => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,
  store,
}).$mount("#app");
